package dao.impl;

import java.util.List;

import entity.Flight;
import table.FlightTable;
import abstractelements.AbstractDao;

public class FlightDao extends AbstractDao<FlightTable, Flight> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public FlightDao(String rootFolderPath) {
		super(rootFolderPath);
	}

	@Override
	public void saveNew(Flight newFlight) {
		final FlightTable flightTable = deserializeFromXml();
		
			flightTable.getRows().add(newFlight);
		serializeToXml(flightTable);
	}

	@Override
	public void update(Flight entity) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Flight get(String login) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Flight> getAll() {
		final FlightTable flightTable = deserializeFromXml();
		return flightTable.getRows();
	}

	@Override
	public void delete(String login) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected Class<FlightTable> getTableClass() {
		return FlightTable.class;
	}


}
